package com.example.cake.entity;


import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.time.LocalDateTime;

@Data
@TableName("sys_crowd")
public class SysCrowd {
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    private String name;
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;
    @TableLogic(value = "0", delval = "1")
//    由于 isDelete 添加了 @TableLogic 注解，MyBatis Plus 做所有查询操作时，自动会在 where 条件后面拼上 is_del = 0，所以 is_del 置一后，实现了逻辑删除
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) //逻辑删除不返回给前端
    private Integer isDelete;
    @TableField(exist = false)
    private String value;
    @TableField(exist = false)
    private String label;

}

